package me.sdevil507.supports.shiro.token;

import me.sdevil507.supports.shiro.enums.LoginChannel;
import me.sdevil507.supports.shiro.enums.LoginModeType;

/**
 * 短信token
 *
 * @author sdevil507
 * created on 2020/8/6
 */
public class SmsToken extends BaseToken {

    /**
     * 手机号
     */
    private String phoneNumber;

    /**
     * 验证码
     */
    private String captcha;

    public SmsToken(String phoneNumber, String captcha, LoginChannel channel, LoginModeType model) {
        super(channel.name(), model.name());
        this.phoneNumber = phoneNumber;
        this.captcha = captcha;
    }

    @Override
    public Object getPrincipal() {
        return this.phoneNumber;
    }

    @Override
    public Object getCredentials() {
        return this.captcha;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getCaptcha() {
        return captcha;
    }

    public void setCaptcha(String captcha) {
        this.captcha = captcha;
    }
}
